﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ZX.EHR.Library;
using ZX.BLL.Extend;
using ZX.Web.UI.Controls;
namespace ZX.WebApp.DeskTop
{
    public partial class Set_DeskTop1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //获取自定义模块
            CreateHtml();
        }
        private void CreateHtml()
        {
            Set_DesktopItem userdeskTopItem = new Set_DesktopItem();
            BaseBussnies<Set_DesktopItem> bll = new BaseBussnies<Set_DesktopItem>();
            bll.entity = userdeskTopItem;
            List<Set_DesktopItem> list = (List<Set_DesktopItem>)bll.GetEntityListByCondition<Set_DesktopItem>("IsDefalt=0");
            System.Text.StringBuilder sbHtml = new System.Text.StringBuilder();

            if (list != null && list.Count > 0)
            {
                int i = 1;
                foreach (Set_DesktopItem deskTopItem in list)
                {
                    sbHtml.Append("<div class='mo'");
                    sbHtml.Append(" id='m"+i+"'");
                    sbHtml.Append(" itemname='" + deskTopItem.ItemName + "' IsDefalt='" + deskTopItem.IsDefalt + "'>");
                    sbHtml.Append("<h1><span");
                    sbHtml.Append(" id='dom"+i+"' >");
                    sbHtml.Append("<img src='../Images/icon/hr.gif' />");
                    sbHtml.Append(deskTopItem.ItemName);
                    sbHtml.Append("</span><font onclick='del_div(this)'>x</font></h1>");
                    sbHtml.Append("<div class='nr'>");
                    sbHtml.Append("</div></div>");
                    i++;
                }

            }
            lblContent.Text = sbHtml.ToString();
            
        }
    }
}